﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using ICSharpCode.AvalonEdit.CodeCompletion;
using System.Windows.Media.Imaging;
using System.Windows.Media;

namespace XslPad.WPF.Completions
{
    internal class XslCompletionData : ICompletionData
    {
        private string _text = string.Empty;

        public XslCompletionData(string text)
        {
            this._text = text;
        }

        public void Complete(ICSharpCode.AvalonEdit.Editing.TextArea textArea, ICSharpCode.AvalonEdit.Document.ISegment completionSegment, EventArgs insertionRequestEventArgs)
        {
            textArea.Document.Replace(completionSegment, this.Text);
        }

        public object Content
        {
            get { return this.Text; }
        }

        public object Description
        {
            get { return "Description pour " + this.Text; }
        }

        public System.Windows.Media.ImageSource Image
        {
            get { return null; }
        }

        public double Priority
        {
            get { return 0.0f; }
        }

        public string Text
        {
            get { return this._text; }
        }
    }
}
